
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	
</head>
<body>
	<select id = "s1">
	  <option value="red">红色</option>
	  <option value="blue" selected>蓝色</option>
	  <option value="yellow">黄色</option>
	  <option value="green">绿色</option>

	</select>
    <div class="content">
        当选中select上的标签 将content中的内容设置为指定的颜色
    </div>

	<script type="text/javascript">
        	var a=document.querySelector(".content")
		document.getElementById("s1").onchange =function(){
            a.style.color=this.value
		}
	</script>
</body>
</html>
